/*
 *  Copyright (C) 2011 Hatsites
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

package org.myorg.ctm.etk.gui.swg.display.create.item.anm.panel;

import org.myorg.ctm.etk.dtb.structure.dtb.tbl.TblAnm;
import org.myorg.ctm.etk.gui.swg.display.create.item.panel.PnlIdtAnm;
import org.myorg.ctm.etk.gui.swg.display.create.panel.PnlNewAbs;

/**
 *
 * @author Hatsites
 *
 * email: Hatsites_AT_gmail.com
 * ... please remove "_AT_" from the above string to get the right email address
 */

public class PnlNewItmAnm extends PnlNewAbs{
    public PnlNewItmAnm(){
        this._pnlID_ = new PnlIdtAnm();
    }

    public boolean init() {
        if(!this._pnlID_.init()){
            return false;
        }



        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(this._pnlID_, javax.swing.GroupLayout.DEFAULT_SIZE, 625, Short.MAX_VALUE)
                )
            )
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(this._pnlID_, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addContainerGap()
            )
        );
        return true;
    }

    public void destroy() {
        return;
    }


    public void writeUserInputs(){

        TblAnm.s_getInstance().setValue(TblAnm.STR_IDT_NOM, this._pnlID_.getIdentiteNom());
        TblAnm.s_getInstance().setValue(TblAnm.STR_IDT_BIRTH, this._pnlID_.getIdentiteDateNaissance());
        TblAnm.s_getInstance().setValue(TblAnm.STR_IDT_DEATH, this._pnlID_.getIdentiteDateMort());
        TblAnm.s_getInstance().setValue(TblAnm.STR_IDT_SEXE, this._pnlID_.getIdentiteSexe());
        TblAnm.s_getInstance().setValue(TblAnm.STR_PRP, this._pnlID_.getIdProprietaire());
        TblAnm.s_getInstance().setValue(TblAnm.STR_CASTRE, this._pnlID_.getCastre());
        TblAnm.s_getInstance().setValue(TblAnm.STR_SPECIE, this._pnlID_.getEspece());
        TblAnm.s_getInstance().setValue(TblAnm.STR_RACE, this._pnlID_.getRace());

    }
    private PnlIdtAnm _pnlID_;

}
